<extend name="Public/base" />
<block name="main">
    <fieldset class="layui-elem-field">
        <legend>权限管理 - 权限组列表</legend>
        <div class="layui-field-box">
            <form class="layui-form" action="">
                <if condition="isset($sms['id'])">
                    <input type="hidden" name="id" value="{$sms['id']}">
                </if>
                <div class="layui-form-item">
                    <label class="layui-form-label">ac</label>
                    <div class="layui-input-block">
                        <input type="text" name="ac" required value="{:(isset($sms['ac'])?$sms['ac']:'')}" lay-verify="required" placeholder="请输入用户账号" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">authkey</label>
                    <div class="layui-input-block">
                        <input type="text" name="authkey" required value="{:(isset($sms['authkey'])?$sms['authkey']:'')}" lay-verify="required" placeholder="请输入认证密钥" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">cgid</label>
                    <div class="layui-input-block">
                        <input type="text" name="cgid" required value="{:(isset($sms['cgid'])?$sms['cgid']:'')}" lay-verify="required" placeholder="请输入通道组编号" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">csid</label>
                    <div class="layui-input-block">
                        <input type="text" name="csid" required value="{:(isset($sms['csid'])?$sms['csid']:'')}" lay-verify="required" placeholder="请输入签名编号" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">重发次数</label>
                    <div class="layui-input-block">
                        <input type="text" name="num" required value="{:(isset($sms['num'])?$sms['num']:'')}" lay-verify="required" placeholder="请输入签名编号" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit lay-filter="formDemo">提交</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </form> 
               
           
        </div>
    </fieldset>
</block>
<block name="myScript">
        <script>
            layui.use('form', function(){
                var form = layui.form();
                form.on('submit(formDemo)', function(data){
                    $.ajax({
                        type: "POST",
                        url: '{:U("configuration")}',
                        data: data.field,
                        success: function(msg){
                            if( msg.code == 1 ){
                                location.reload();
                            }else{
                                parent.layer.msg(msg.msg, {
                                    icon: 5,
                                    shade: [0.6, '#393D49'],
                                    time:1500
                                });
                            }
                        }
                    });
                    return false;
                });

            });
        </script>
       
</block>